package com.databaseManager;

/**
 * @author addzero
 * @version 1.0
 * 科室预约单实体类
 * {@inheritDoc}
 */
public class DepOrder extends Order {
    private String DepNo;
    private String DepName;

    /**
     * DepOrder类构造函数
     * @param depNo 科别编号，长度为7位
     * @see Order#Order(long, String, String)
     */
    public DepOrder(long PRid, String pid, String PTime, String depNo) throws Exception {
        super(PRid, pid, PTime);
        DepNo = depNo;
        DatabaseFunc df = new DatabaseFunc();
        DepName = df.findDepartment(depNo, SqlOP.GETDEPNAME);
    }

    public String getDepNo() {
        return DepNo;
    }

    public void setDepNo(String depNo) throws Exception {
        DepNo = depNo;
        DatabaseFunc df = new DatabaseFunc();
        DepName = df.findDepartment(depNo, SqlOP.GETDEPNAME);
    }

    public String getDepName() {
        return DepName;
    }

    public void setDepName(String depName) throws Exception {
        DepName = depName;
        DatabaseFunc df = new DatabaseFunc();
        DepNo = df.findDepartment(depName, SqlOP.GETDEPNO);
    }
}
